package com.yonyou.brigade.third_parties.ctrip.bigcustomer.service.impl;

import com.yonyou.brigade.third_parties.ctrip.bigcustomer.service.ICtripBigCustomerApplyService;
import com.yonyou.ybzboot.starter.common.constant.GlobalConstant;
import corp.openapicalls.contract.setapproval.request.SetApprovalRequest;
import corp.openapicalls.contract.setapproval.request.SetApprovalServiceRequest;
import corp.openapicalls.contract.setapproval.response.SetApprovalResponse;
import corp.openapicalls.contract.ticket.TicketResponse;
import corp.openapicalls.service.setapproval.SetApprovalService;
import corp.openapicalls.service.ticket.CorpTicketService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class CtripBigCustomerApplyServiceImpl implements ICtripBigCustomerApplyService {

    private Logger logger=LoggerFactory.getLogger(CtripBigCustomerApplyServiceImpl.class);

    public void pushApplyVoucherToCtrip(SetApprovalServiceRequest approvalServiceRequest )
    {
        SetApprovalService setapprovalService = new SetApprovalService();
        logger.info(approvalServiceRequest.toString());
        System.out.println(approvalServiceRequest.toString());
//暂时不进行真实的数据推送
        SetApprovalResponse setApprovalResponse = setapprovalService.SetApproval(approvalServiceRequest);
        if (null != setApprovalResponse && null != setApprovalResponse.getStatus() && setApprovalResponse.getStatus().getSuccess()) {
            logger.info("向携程推送数据:推送数据成功！");
        }else{
            logger.info("向携程推送数据:调用提前审批接口失败！");
        }
    }
}
